<template>
    <div class="header">
        <div class="left">
            <div class="iconfont icon-left">&#xe658;</div>
        </div>
        <div class="input">
            <span class="iconfont">&#xe63c;</span>
            旅游景点推荐/温泉/酒店/住宿
            </div>
        <router-link to="/city">
        <div class="right">
            {{this.city}}
            <span class="iconfont">&#xe65c;</span>
        </div>
        </router-link>
    </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city']) // 把Vuex的数据映射到当前组件的计算属性里 ：把city这个数据映射到名字叫做city的计算属性中
  }
}
</script>

<style lang="stylus" scoped>
@import '../../assets/styles/mixins.styl'
 .header
  line-height:.86rem
  display: flex
  background: #00bcd4
  color: #fff
  .left
   width: .64rem
   float left
   .icon-left
    text-align:center
    font-size:.4rem
  .input
   flex: 1
   height:.64rem
   line-height: .64rem
   border-radius: .1rem
   background:#fff
   margin-top:.12rem
   margin-left: .2rem
   color: #ccc
   padding-left: .2rem
  .right
   min-width: 1.04rem
   float: right
   text-align: center
   color:#fff
</style>
